<!DOCTYPE html>
<html>
<head>
    <title>支付交易订单流水（支付、退款）</title>
    #parse("sys/header.html")
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList">
        <div class="grid-btn" style="width: 100%;height: 100px;">
            <div class="form-group col-sm-2" style="width: 240px">
                <input id="recordno" type="text" class="form-control" v-model="payorder.recordno" @keyup.enter="query"
                       placeholder="订单号，只能输入英文、数字" maxlength = "25" onkeyup="value=value.replace(/[^\a-\z\A-\Z0-9]/g,'')">
            </div>
            <div class="form-group col-sm-2" style="width: 180px">
                <input id="orderdateBegin" name="orderdateBegin" type="text" class="form-control"
                       v-model="payorder.orderdateBegin" @keyup.enter="query"
                       onClick="WdatePicker({dateFmt:'yyyy-MM-dd',maxDate:'#F{$dp.$D(\'orderdateEnd\')||\'2120-10-01\'}'})"
                       placeholder="订单创建开始时间">
            </div>
            <div class="form-group col-sm-2" style="width:180px">
                <input id="orderdateEnd" name="orderdateEnd" class="form-control" @keyup.enter="query"
                       v-model="payorder.orderdateEnd"
                       onClick="WdatePicker({dateFmt:'yyyy-MM-dd',minDate:'#F{$dp.$D(\'orderdateBegin\')}',maxDate:'2120-10-01'})"
                       placeholder="订单创建结束时间">
            </div>
            <div class="form-group  col-sm-2 " style="width: 180px">
                <select class="form-control" id="resource" name="resource">
                    <option value="">请选择支付方式</option>
                    <option value="0">微信</option>
                    <option value="1">支付宝</option>
                </select>
            </div>
            <div  class="form-group  col-sm-2 " style="width: 180px">
                <select class="form-control" id="status" name="status">
                    <option value="">请选择订单状态</option>
                    <option value="0">支付失败</option>
                    <option value="1">已付款</option>
                    <option value="2">已退款</option>
                    <option value="3">已对账</option>
                    <option value="4">已关闭</option>
                    <option value="5">退款处理中</option>
                    <option value="6">未确定，需重新发起</option>
                    <option value="7">转入代发</option>
                    <option value="9">异常</option>
                    <option value="10">转入退款</option>
                    <option value="11">未支付</option>
                    <option value="12">已冲正</option>
                    <option value="13">已撤销</option>
                    <option value="14">退款失败</option>
                </select>
            </div>
            
            <div class="form-group col-sm-2" style="width: 280px;clear:both;">
                <input id="cashiersName" type="text" maxlength="10" class="form-control" v-model="payorder.name" @keyup.enter="query"
                       placeholder="收款员名称，只能是中英文、数字" onkeyup="value=value.replace(/[^\a-\z\A-\Z0-9\u4E00-\u9FA5]/g,'')">
            </div>
            <div class="form-group col-sm-2" style="width: 240px;">
                <input id="codeNo" type="text" maxlength="20" class="form-control" v-model="payorder.codeNo" @keyup.enter="query"
                       placeholder="收款码编号，只能是数字" onkeyup="value=value.replace(/[^\d]/g,'')">
            </div>
            <div class="form-group col-sm-2" style="width: 260px">
                <input id="shopname" type="text" maxlength="25" class="form-control" v-model="payorder.shopname" @keyup.enter="query"
                       placeholder="店铺名称，只能中英文、数字" onkeyup="value=value.replace(/[^\a-\z\A-\Z0-9\u4E00-\u9FA5]/g,'')">
            </div>
            <div class="form-group col-sm-2" style="width: 180px">
	            <a class="btn btn-default" @click="query">查询</a>
	            #if($shiro.hasPermission("payorder:refund"))
	            <a class="btn btn-primary" onclick="refundInfo()">&nbsp;退款</a>
	            #end
	            #if($shiro.hasPermission("payorder:update"))
	            <a class="btn btn-primary" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</a>
	            #end
            </div>
        </div>
        <table id="jqGrid"></table>
        <div id="jqGridPager"></div>
    </div>

    <div v-show="!showList" class="panel panel-default">
        <div class="panel-heading">{{title}}</div>
        <form class="form-horizontal">
            <div class="form-group">
                <div class="col-sm-2 control-label">订单号</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="payorder.recordno" placeholder="订单号"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">订单创建时间</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="payorder.orderdate" placeholder="订单创建时间"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">来源（0 微信、1 支付宝）</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="payorder.resource" placeholder="来源（0  微信、1  支付宝）"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">商户ID</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="payorder.busid" placeholder="商户ID"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">类型（0 支付 1 退款）</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="payorder.category" placeholder="类型（0 支付  1  退款）"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">支付状态（0 未知 1 已付款 2 已退款 3 已对账）</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="payorder.status"
                           placeholder="支付状态（0  未知  1  已付款  2  已退款  3  已对账）"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">退款类型（0 部分 1 全额）</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="payorder.refundtype"
                           placeholder="退款类型（0  部分   1 全额）"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">金额</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="payorder.amount" placeholder="金额"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">银行标识</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="payorder.banksigns" placeholder="银行标识"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">退款时对应的交易订单ID</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="payorder.orderid" placeholder="退款时对应的交易订单ID"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">备注</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="payorder.remark" placeholder="备注"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label"></div>
                <input type="button" class="btn btn-primary" @click="saveOrUpdate" value="确定"/>
                &nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="reload" value="返回"/>
            </div>
        </form>
    </div>
</div>
<script src="${rc.contextPath}/js/My97DatePicker/WdatePicker.js"></script>
<script src="${rc.contextPath}/js/pay/payorder.js?_${date.systemTime}"></script>
<script>
    function refundInfo() {
        var id = getSelectedRow();
        if (id == null) {
            return;
        }
        parent.layer.open({
            type: 2,
            title: '退款信息(退款只能退当天,退款是原路退回)',
            shadeClose: true,
            shade: 0.8,
            fixed: false,
            maxmin: true,
            area: ['60%', '50%'],
            content: 'pay/refundView.html?id=' + id
        });
    }
</script>

</body>
</html>